"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var Person = /** @class */ (function () {
    //构造函数
    function Person(name, age) {
        this.name = name;
        this.age = age;
    }
    Person.prototype.sing = function () {
        console.log('唱');
        this.run();
    };
    Person.prototype.run = function () {
        this.sing();
        console.log(this.age + '的' + this.name + "" + ' 跑');
    };
    return Person;
}());
var person = new Person('李思', 23);
// person.run()//属性“run”受保护，只能在类“Person”及其子类中访问
var Male = /** @class */ (function (_super) {
    __extends(Male, _super);
    function Male(name, age) {
        return _super.call(this, name, age) || this;
    }
    Male.prototype.ts = function () {
        this.run();
        // this.sing()//属性“sing”为私有属性，只能在类“Person”中访问。 错误
    };
    Male.num = 1; //静态成员属性
    return Male;
}(Person));
console.log(Male.num); //不需要实例化就可以访问的静态属性
var m = new Male('李思1', 23);
// console.log(m.age);//属性“age”为私有属性，只能在类“Person”中访问
// m.run()//属性“run”受保护，只能在类“Person”及其子类中访问
